/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package testklient;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;
import theserver.DeviceInfo;

/**
 *
 * @author Emma
 */
public class ServerSocketen implements Runnable{
private Thread t = new Thread(this);
ServerSocket serverSocket;
Socket socket;
private DeviceInfo mySelf;
private GUI gui;
private int port;

public ServerSocketen(DeviceInfo mySelf, GUI gui, int port){
        try {
            this.port = port;
            this.gui = gui;
            this.mySelf = mySelf;
            serverSocket = new ServerSocket(port);
            t.start();
        } catch (IOException ex) {
            Logger.getLogger(ServerSocketen.class.getName()).log(Level.SEVERE, null, ex);
        }

}
    public void run() {
        while(true){
            try {
                Socketocketsaken  ssoee = new Socketocketsaken( serverSocket.accept(), mySelf, gui);

            } catch (IOException ex) {
                Logger.getLogger(ServerSocketen.class.getName()).log(Level.SEVERE, null, ex);
            }
        }

    }
}
